package com.rykj.widget.bottomnavigation;

import java.util.ArrayList;
import java.util.List;

/**
 * Description ：
 * <p/>
 * @author ycw Created by ycw on 2017/5/5.
 */

public class BottomObservable {

    private List<BottomObserver> mObservers = new ArrayList<>();

    public void addObserver(BottomObserver observer) {
        mObservers.add(observer);
    }

    public void addAllObserver(List<? extends BottomObserver> observer) {
        mObservers.addAll(observer);
    }

    public void removeObserver(BottomObserver observer) {
        mObservers.remove(observer);
    }

    public void notifyObservers(BottomObserver observer) {
        for (BottomObserver bottomObserver : mObservers) {
            bottomObserver.update(observer);
        }
    }

}
